]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
iconGrid: Only use page relative coords for orientation in getDropTarget
authorSebastian Keller <skeller@gnome.org>
Sun, 14 Mar 2021 16:32:26 +0000 (17:32 +0100)
committerMarge Bot <marge-bot@gnome.org>
Sun, 14 Mar 2021 18:44:03 +0000 (18:44 +0000)
The x and y coordinates were both adjusted to be page relative, even
though the icon grid can only scroll in one direction. This was leading
to coordinates outside of the icon grid to be considered part of it and
a wrong drop target to be chosen.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3779

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1767>

js/ui/iconGrid.js

index ddebc308e1e3e0368244573a9c97946e2cca85e7..cdceb020df2e032f2c97618a326683f48b1014eb 100644 (file)
@@ -1050,8 +1050,10 @@ var IconGridLayout = GObject.registerClass({
             page = swap(page, this._pages.length);
 
         // Page-relative coordinates from now on
-        x %= this._pageWidth;
-        y %= this._pageHeight;
+        if (this._orientation === Clutter.Orientation.HORIZONTAL)
+            x %= this._pageWidth;
+        else
+            y %= this._pageHeight;
 
         if (x < leftEmptySpace || y < topEmptySpace)
             return [null, DragLocation.INVALID];